package com.bps.zzant.dao;

import java.util.List;

import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import com.bps.zzant.model.Product;

public class ProductDAOImpl implements ProductDAO {

	@Autowired
	private SessionFactory sessionFactory;
	
	public List getProductByStyleNo(String styleNo) {
		System.out.print("----++++++-----ProductDAOImpl.getProductByStyleNo:" + styleNo);
		List<Product> productList = sessionFactory.getCurrentSession().createCriteria(Product.class).add(Restrictions.like("styleNo", styleNo)).list();
		return productList;
	}

}
